package com.lms.util;

import java.util.Random;

/**
 * @Description: 随机生成固定位数字符串
 * @author: L-B-S
 * @Date: 2021/4/3 10:08
 * @modified_By:
 * @Version: 0.0$
 */
public class RandomUtil {

    public static String randomNumbers(int length) {
        String str = "0123456789";
        Random random = new Random();
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < length; i++) {
            int number = random.nextInt(10);
            builder.append(str.charAt(number));
        }
        return builder.toString();
    }
}
